<template>
  <div class="page-header-index-wide">
    <div>
      <div class="account-settings-info-left" v-if="false">
        <a-menu
          mode="horizontal"
          :selectedKeys="selectedKeys"
          type="inner"
          @openChange="onOpenChange"
          style="padding:8px 16px 0;"
        >
          <!-- <a-menu-item key="/marketing/marketExpand/forExample" class="border-cantainer" >
            <router-link :to="{ name: 'forExample' }">
              <div class="border_catainer_bottom">火爆案例</div>
            </router-link> 
          </a-menu-item>-->
          <a-menu-item key="/marketing/marketExpand/mineActivity" class="border-cantainer">
            <router-link :to="{ name: 'mineActivity' }">
              <div class="border_catainer_bottom">我的招生活动</div>
            </router-link>
          </a-menu-item>
          <a-menu-item
            key="/marketing/marketExpand/child/activityTemplateCenter"
            v-if="false"
            class="border-cantainer"
          >
            <router-link :to="{ name: 'activityTemplateCenter' }">
              <div class="border_catainer_bottom">活动素材中心</div>
            </router-link>
          </a-menu-item>
          <a-menu-item
            key="/marketing/marketExpand/child/dataCount"
            v-if="false"
            class="border-cantainer"
          >
            <router-link :to="{ name: 'dataCount' }">
              <div class="border_catainer_bottom">数据统计</div>
            </router-link>
          </a-menu-item>
        </a-menu>
      </div>
      <div :class="disPLAY_none==true?'':'quittanceChildren'">
        <route-view></route-view>
      </div>
    </div>
  </div>
</template>
<script>
import { PageView, RouteView } from '@/layouts'
import { mixinDevice } from '@/utils/mixin.js'

export default {
  components: {
    RouteView,
    PageView,
  },
  mixins: [mixinDevice],
  data() {
    return {
      // horizontal  inline
      mode: 'inline',

      openKeys: [],
      selectedKeys: [],
      disPLAY_none: false,
      // cropper
      preview: {},
      option: {
        img: '/avatar2.jpg',
        info: true,
        size: 1,
        outputType: 'jpeg',
        canScale: false,
        autoCrop: true,
        // 只有自动截图开启 宽度高度才生效
        autoCropWidth: 180,
        autoCropHeight: 180,
        fixedBox: true,
        // 开启宽度和高度比例
        fixed: true,
        fixedNumber: [1, 1],
      },

      pageTitle: '',
    }
  },
  mounted() {
    this.updateMenu()
  },
  methods: {
    onOpenChange(openKeys) {
      this.openKeys = openKeys
    },
    updateMenu(to) {
      const routes = this.$route.matched.concat()
      this.selectedKeys = [routes.pop().path]
      if (
        this.selectedKeys[0] == '/educationalCenter/addCourse' ||
        this.selectedKeys[0] == '/marketing/marketExpand/child/activityTemplateCenter'||
        this.selectedKeys[0] == '/marketing/marketExpand/child/dataCount'
      ) {
        this.disPLAY_none = true
      } else {
        this.disPLAY_none = false
      }
    },
  },
  watch: {
    $route(val) {
      this.updateMenu()
    },
  },
}
</script>

<style lang="less">
.border-cantainer {
  padding: 0 10px;
  margin-right: 40px;
}
.menu-box {
  display: flex;
  align-items: center;
  .menu-item {
    width: 80px;
    margin-right: 20px;
    text-align: center;
    cursor: pointer;
    color: #333;
  }
}
</style>
